Skip to content

Remove ADAL dependency: Migrate Windows AAD Integrated Auth to MSQA APIs via mssql-auth.dll.#2864

Merged
Ananya2 merged 4 commits intomainfrom
user/anagarg/deprecate-adal
Mar 3, 2026
Merged

Remove ADAL dependency: Migrate Windows AAD Integrated Auth to MSQA APIs via mssql-auth.dll.#2864
Ananya2 merged 4 commits intomainfrom
user/anagarg/deprecate-adal

Conversation

@Ananya2
Copy link
Contributor

@Ananya2 Ananya2 commented Dec 17, 2025

Summary

This PR removes the last remaining ADAL dependency in the JDBC driver by migrating Windows Active Directory Integrated Authentication from the deprecated ADAL library to MSQA (Microsoft SQL Query Authentication) APIs. The authentication flow now uses mssql-auth.dll instead of the legacy adalsql.dll (ADAL-based).

Problem Statement

Windows AAD Integrated authentication relies on native calls through mssql-jdbc_auth.dll, which called the deprecated adalsql.dll (ADAL). This was the last remaining ADAL dependency in the JDBC driver and needed to be removed as part of Microsoft's ADAL deprecation initiative.

Solution

This change modernizes Windows AAD Integrated Authentication by refactoring the native auth flow to route all token acquisition through MSQA APIs via mssql-auth.dll, replacing legacy ADAL usage with MSAL C++ and fully removing the adalsql.dll dependency. The JNI interface has been updated to align with the new MSQA-based native contract, eliminating ADAL-specific parameters and references, and updating error messages to reflect the new DLL architecture.

Old Flow:
SQLServerConnection.java → mssql-jdbc-auth.dll (JNI wrapper) → adalsql.dll (deprecated ADAL) → Azure Active Directory
New Flow:
SQLServerConnection.java → mssql-jdbc-auth.dll (JNI wrapper) → mssql-auth.dll (MSAL C++) → Azure Active Directory

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.91%. Comparing base (20ed864) to head (6ccd452).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2864      +/-   ##
============================================
+ Coverage     60.59%   62.91%   +2.31%     
- Complexity     4902     5481     +579     
============================================
  Files           151      151              
  Lines         34827    38362    +3535     
  Branches       5834     6967    +1133     
============================================
+ Hits          21105    24135    +3030     
- Misses        10902    11184     +282     
- Partials       2820     3043     +223     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ananya2 Ananya2 added this to the 13.3.2 milestone Feb 2, 2026
@github-project-automation github-project-automation bot moved this to In progress in MSSQL JDBC Feb 2, 2026
@Ananya2
Copy link
Contributor Author

Ananya2 commented Feb 20, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Ananya2 Ananya2 merged commit f49f36c into main Mar 3, 2026
18 of 19 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Closed/Merged PRs in MSSQL JDBC Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed/Merged PRs

Development

Successfully merging this pull request may close these issues.

3 participants